#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def cached(fn):
    cache = {}

    def cachedFn(id):
        hit = id in cache
        if hit:
            return cache[id]
        else:
            cache[id] = fn(id)
            return cache[id]
    return cachedFn

if __name__ == "__main__":
    pass